<?php
session_start();
require_once($_SERVER['DOCUMENT_ROOT'].'../system/config.php');
require_once($INCLUDE_DIR.'recaptcha/recaptchalib.php');
$captcha_key = '6LeQJAcAAAAAAIqS8GF5NcNHYtOqSDiZ4WTE51e7';
?>
<html>
<head>
	<link rel="stylesheet" href="<?=$CSS_DIR?>blueprint/miniscreen.css" type="text/css" media="screen, projection" />
	 <!--[if IE]><link rel="stylesheet" href="<?=$CSS_DIR?>blueprint/ie.css" type="text/css" media="screen, projection" /><![endif]-->

	<!-- for iphone -->
	<meta name="viewport" content="width=device-width; initial-scale=.8; maximum-scale=1.0; user-scalable=0;" />

</head>
<body>
<div class="container">
	<div class="span-8 last">
		<form action="register_check.php" method="POST">
				<h3>Registration:</h3>
<?php if(isset($_SESSION['error'])): ?>
					<div class="span-8 last error"><?=$_SESSION['error']?></div>
<?php 
	endif;
?>
					Please complete the form below (* required field):
					<hr />
					<div class="span-3"> Username*: </div>
<?php if(isset($_SESSION['username'])): ?>
					<div class="span-5 last"><input type="text" name="username" value="<?=$_SESSION['username']?>"></div>
<?php else: ?>
					<div class="span-5 last"><input type="text" name="username"></div>
<?php endif; ?>
					<div class="span-3"> Password*: </div>
					<div class="span-5 last"><input type="password" name="password"></div>
					<div class="span-3"> Repeat Password*: </div>
					<div class="span-5 last"><input type="password" name="repassword"></div>
					<div class="span-3"> Email: </div>
<?php if(isset($_SESSION['email'])): ?>
					<div class="span-5 last"><input type="text" name="email" value="<?=$_SESSION['email']?>"></div>
<?php else: ?>
					<div class="span-5 last"><input type="text" name="email"></div>
<?php endif; ?>
					<div class="span-3"> First Name: </div>
<?php if(isset($_SESSION['first'])): ?>
					<div class="span-5 last"><input type="text" name="first" value="<?=$_SESSION['first']?>"></div>
<?php else: ?>
					<div class="span-5 last"><input type="text" name="first"></div>
<?php endif; ?>
					<div class="span-3"> Last Name: </div>
<?php if(isset($_SESSION['last'])): ?>
					<div class="span-5 last"><input type="text" name="last" value="<?=$_SESSION['last']?>"></div>
<?php else: ?>
					<div class="span-5 last"><input type="text" name="last"></div>
<?php endif; ?>
					<hr />
					<div class="span-8 last"><?php echo recaptcha_get_html($captcha_key); ?></div>
					<hr />

					<div class="span-3 last"><input type="submit" value="Submit.">
		</form>
	</div>
</div>
</body>
</html>
<?php 
	session_destroy(); 
?>
